package com.springboot.code.config;

/**
 * DESC:响应编码
 *
 * @author WangJie
 * @date Created in 2023-05-28 11:48
 */
public enum ResultCode {

    /**操作成功**/
    RC200(200,"操作成功"),
    /**操作失败**/
    RC999(999,"操作失败"),
    /**服务限流**/
    RC100(100,"服务器开启限流保护,请稍后再试！"),
    /**服务降级**/
    RC201(201,"服务器开启降级保护,请稍后再试！"),
    /**热点参数限流**/
    RC202(202,"热点参数限流,请稍后再试！"),
    /**系统规则不满足要求**/
    RC203(203,"系统规则不满足要求,请稍后再试！"),
    /**授权规则不通过**/
    RC204(204,"授权规则不通过,请稍后再试！"),
    /**access_denied**/
    RC403(403,"无访问权限,请联系管理员授予权限"),
    /**Not,Found~**/
    RC404(404,"没有找到您所要访问的页面,请重试"),
    /**access_denied**/
    RC401(401,"匿名用户访问无权限资源时的异常"),
    /**服务器异常**/
    RC500(500,"系统异常,请稍后重试~"),
    /**访问令牌不合法**/
    INVALID_TOKEN(2001,"访问令牌不合法"),
    /**访问令牌不合法**/
    ACCESS_DENIED(2003,"没有权限访问该资源"),
    /**客户端认证出错**/
    CLIENT_AUTHENTICATION_FAILED(1001,"客户端认证失败"),
    /**用户名或者密码错误**/
    USERNAME_OR_PASSWORD(1002,"用户名或者密码错误"),
    /**不支持的用户认证模式**/
    UNSUPPORTED_GRANT_TYPE(1003,"不支持的认证模式");


    /** 自定义状态码 **/
    private final Integer code;
    /**自定义描述**/
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode(){
        return code ;
    }

    public String getMessage (){
        return message;
    }


/*    public static final ApiResult SUCCESS = new ApiResult(200, "成功");

    public static final ApiResult INSERT_SUCCESS = new ApiResult(200, "新增成功");

    public static final ApiResult UPDATE_SUCCESS = new ApiResult(200, "更新成功");

    public static final ApiResult DELETE_SUCCESS = new ApiResult(200, "删除成功");

    public static final ApiResult UPLOAD_SUCCESS = new ApiResult(200, "上传成功");

    public static final ApiResult DOWNLOAD_SUCCESS = new ApiResult(200, "下载成功");

    public static final ApiResult LOGIN_SUCCESS = new ApiResult(200, "登陆成功");

    public static final ApiResult LOGOUT_SUCCESS = new ApiResult(200, "登出成功");

    public static final ApiResult LOGIN_ERROR = new ApiResult(201, "登陆错误");

    public static final ApiResult LOGIN_EXPIRE = new ApiResult(202, "登陆过期");

    public static final ApiResult ACCESS_LIMITED = new ApiResult(301, "访问受限");

    public static final ApiResult ARGS_ERROR = new ApiResult(501, "参数错误");

    public static final ApiResult UNKOWN_ERROR = new ApiResult(502, "系统异常");

    public static final ApiResult INSERT_ERROR = new ApiResult(503, "新增错误");

    public static final ApiResult UPDATE_ERROR = new ApiResult(504, "更新错误");

    public static final ApiResult DELETE_ERROR = new ApiResult(506, "删除错误");

    public static final ApiResult UPLOAD_ERROR = new ApiResult(507, "上传错误");

    public static final ApiResult DOWNLOAD_ERROR = new ApiResult(508, "下载错误");

    public static final ApiResult OTHER_SYSTEM_ERROR = new ApiResult(509, "调用系统异常");*/
}
